$(function () {
    $.material.init();
    $('#toggleMenu,.body-cover').click(function () {
        $('.left-menu-box').toggleClass('active');
        $('.body-cover').toggle();
    });
    //注销
    $('a.logout').click(function () {
        localStorage.removeItem('token');
        localStorage.removeItem('sign');
        localStorage.removeItem('userInfo');
        localStorage.removeItem('suid');
        location.href= '../../index.html';
    });
    //登录用户信息
    if(localStorage.userInfo){
        var infoJson = JSON.parse(localStorage.userInfo);
        var url = urlParam.basePictureUrl + infoJson.headphoto;
        if(!infoJson.headphoto){
            url = 'http://flup.leley.com/cholecystectomy/assets/avatars/avatar4.png';
            if(infoJson.sex == '女') url = 'http://flup.leley.com/cholecystectomy/assets/avatars/avatar3.png';
        }
        $('.user-info .face').attr('src',url);
        $('.user-info .name').text(infoJson.name);
        $('.user-info .job').text(infoJson.titlename);
        $('.user-info .address').text(infoJson.hospname +'  ' + infoJson.deptname);
    }
    $('.header-title').text((localStorage.projectName || '诊后随访'));
});